﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page import="nc.vo.sm.UserVO"%>
<%@ page import="nc.bs.ebvp.login.Constant"%>
<%@ page import="nc.bs.ebvp.sourcingcoll.Constants"%>
<%@ page import="nc.bs.ebvppub.ebvpservicefactory.LoadConfigProperty"%>
<%
	String basePath = request.getContextPath();
	String strProjPk = request.getParameter("pkProj");
	Integer chenggong = (Integer)request.getAttribute("chenggong");
	String strParaEc021 = (String)request.getSession().getAttribute(Constants.ID_EC021);
	UserVO userVo = (UserVO)request.getSession().getAttribute(Constant.USER_INFO);
	boolean isClientCa = false;
	//供应商客户端是否支持CA
	if("Y".equalsIgnoreCase(strParaEc021) || (null != userVo.getIsca() && userVo.getIsca().booleanValue())){
		isClientCa = true;
	}
	//CA厂商名称
	String strCaFactory = (String)request.getSession().getAttribute(LoadConfigProperty.EBVP_CA_FACTORY);
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>中标结果确认</title>
		<%if(isClientCa){%>
			<%if(Constants.CA_FACTORY_ITRUS.equals(strCaFactory)){%>
				<script type="text/javascript" src="js/itrusforNC.js"></script>
				<script type="text/javascript" src="js/pta.js"></script>
			<%} else if(Constants.CA_FACTORY_INFOSEC.equals(strCaFactory)){%>
				<script type="text/javascript" src="js/Infosec4NC.js"></script>
			<%} else if(Constants.CA_FACTORY_DEAN.equals(strCaFactory)){%>
				<script type="text/javascript" src="js/DatechJs.js"></script>
			<%} %>
		<%}%>
	</head>
	<body class="fullbody" onload="init();">
		<div class="context">
			<div class="position">
				<div class="tposi">
					当前位置：
					<a href="<%=basePath%>/infopub/pubmain"	class="linkstyle">首页</a> &nbsp;&gt;&gt;&nbsp;
					<a href="<%=basePath%>/sourcing/projlist" class="linkstyle">我的投标\谈判\询价</a> &nbsp;&gt;&gt;&nbsp;
					<a href="<%=basePath%>/sourcing/biddingprojlist" class="linkstyle">进行中的项目</a> &nbsp;&gt;&gt;&nbsp;
					<a href="<%=basePath%>/sourcing/biddingprojlist/projexec?pk_pur_project=<%=strProjPk%>" class="linkstyle">${resultInform.project_name}</a> &nbsp;&gt;&gt;&nbsp;
					<span class="curposition">中标结果确认</span>
				</div>
				<div class="help">
                  <a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/ZBJGQR.html');" class="linkstyle">帮助</a>
              	</div>
			</div>
			<div class="margin8">
			</div>
			<div class="subpage_title">
				<div class="title_index">
                     <img src="<%=basePath%>/images/common/dot03.gif" alt="" border="0" />&nbsp;中标结果确认
                 </div>
			</div>
			<div class="margin20">
            </div>
			<div class="subpage_bidlist">
				<table width="95%" border="0" cellpadding="0" cellspacing="0" class="releasefile">
					<form action="" method="post" name="replyform">
					<input type="hidden" name="casn" value=""/>
					<input type="hidden" name="signature" value=""/>
					<tr>
						<td width="25%" height="28" align="left" colspan="4">
							<span class="filelabel">中标公告标题：</span>
							<input readonly="readonly" name='pub_title' type='hidden' id='textfield3' size='50' value="<c:if test="${resultInform.pub_title != null}">${resultInform.pub_title}</c:if>" />
						<c:if test="${resultInform.pub_title != null}">${resultInform.pub_title}</c:if>
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right" valign="top">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="11.3%" align="left" valign="top" style="font-size: 12px;">
										<span class="filelabel">中标公告内容：</span>
									</td>
									<td width="70%" align="left">
										<input readonly="readonly"  name="pub_txt" id="textarea2" type='hidden' value="<c:if test="${resultInform.pub_txt != null}">${resultInform.pub_txt}</c:if>"/>
									<c:if test="${resultInform.pub_txt != null}">${resultInform.pub_txt}</c:if>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr><td width="100%" height="28" align="left" style="font-size: 12px; color:red" colspan="4" id="msgLine"></td></tr>
					<tr>
						<td colspan="4" align="right" valign="top">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<td width="113" height="40" align="center">
									&nbsp;
								</td>
								<c:if test="${fig != null}">
									<td width="197" align="right">
										<img src="<%=basePath%>/images/common/botton_confirmation.jpg" width="60" height="20" border="0" onclick="doReply('${resultInform.pk_pur_project}'),'${fig}'" style="cursor: hand" />
									</td>
									<td width="113" align="center">
										<img src="<%=basePath%>/images/common/botton_back.jpg" width="60" height="20" border="0" style="cursor: hand"	onclick="getProjExecInfo('${resultInform.pk_pur_project}')" />
									</td>
									<td width="187" align="center">
									&nbsp;
									</td>
								</c:if>
								<c:if test="${fig == null}">
									<td width="197" align="center">
										<img src="<%=basePath%>/images/common/botton_back.jpg" width="60" height="20" border="0" style="cursor: hand"	onclick="getProjExecInfo('${resultInform.pk_pur_project}')" />
									</td>
								</c:if>
							</table>
						</td>
					</tr>
					</form>
					<form name="biddingprojlist" id="biddingprojlist" action="" method="get">
							<script type="text/javascript">
								function getProjExecInfo(pk_pur_project){
									document.getElementById("pk_pur_project").value = pk_pur_project;
									document.biddingprojlist.action = "<%=request.getContextPath()%>/sourcing/biddingprojlist/projexec";
									document.biddingprojlist.submit();
								}
							</script>
							<input type="hidden" id="pk_pur_project" name="pk_pur_project" />
					</form>
				</table>		
			</div>
		</div>
		<script language="javascript">
			//提交响应信息
			function doReply(pk_pur_project,fig){
				<%if(isClientCa){%>
					//证书SN
					var strSn = getSN("${USER_CODE}")
					if(strSn == null || strSn == ""){
						alert("请插入Key后再进行操作！");
						return;
					}
					document.replyform.casn.value = strSn;
					//方案主键|发布类单据主键|供应商对应用户主键
					var strSignData = "${resultInform.pk_pur_project}" + "|" + "${USER_ID}";
					//签名
					document.replyform.signature.value = signmessage(strSignData,"${USER_CODE}");
				<%}%>
				document.replyform.action = "<%=basePath%>/sourcing/resultinform/resultinform?pk_pur_project="+pk_pur_project+"&fig="+fig;
				document.replyform.submit();
			}

			function init(){
				var jgrows = <%=chenggong%>
				if(jgrows == 1){
					showMsg("确认成功！");
				}else if(jgrows == 2){
					showMsg("已确认，不允许重复确认！");
				}
			}
			
			var showMsg = function(msg){
				document.getElementById('msgLine').innerText = msg;
			}
		</script>
	</body>
</html>
